<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en" class="no-js" id="ng-app">
<head>
<meta charset="UTF-8">
<jsp:include page="/includes/common/head.jsp" />
<title>CS4280 BOOKSTORE</title>
</head>
<body>
	<div data-flex-background-src="${ baseURL }/assets/img/background.jpg"
		flex-background></div>
	<jsp:include page="/includes/header.jsp">
		<jsp:param name="currentUser" value="${currentUser}" /><jsp:param name="baseURL" value="${ baseURL }" />
		
	</jsp:include>
	<section id="mainContent">
		<c:if test="${action == null}">
			<form method="POST" action="${ baseURL }/login">
				<ul>
					<li><label>Username: </label> <input type="text"
						name="username" /></li>
					<li><label>Password: </label> <input type="password"
						name="password" /></li>
				</ul>
				<input type="submit" value="Login"/>
				<input type="hidden" name="action" value="login_check" />
			</form>
		</c:if>
		
		<c:if test="${action == 'succeeded'}">
			<p>
				Login Success. You may visit:
			</p>
			<a href="${ baseURL }/home">Home Page</a><br />
			<a href="${ baseURL }/member">Member Center</a><br />
		</c:if>
		
		<c:if test="${action == 'failed'}">
			<form method="POST" action="${ baseURL }/login">
				<span class="form-error">Username or password are wrong. Please try again.</span>
				<ul>
					<li><label>Username: </label> <input type="text"
						name="username" value="${ input.username }"/></li>
					<li><label>Password: </label> <input type="password"
						name="password" /></li>
				</ul>
				<input type="submit" value="Login"/>
				<input type="hidden" name="action" value="login_check" />
			</form>
		</c:if>
	</section>
</body>
</html>